package zjh_20230314;

public class Account {
    private long id;
    private double balance;
    private String password;

    private static int sum = 1;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    Account(double balance, String password) {
        this.id = sum++;
        this.balance = balance;
        this.password = password;
    }

    public String toString() {
        return id + "," + balance + "," + password;
    }

    public static void main(String[] args) {
        Account account = new Account(2, "123");
        Account account1 = new Account(5, "123");
        System.out.println(account.toString());
        System.out.println(account1.toString());
    }

}
